package jd.se.register;

import jd.se.common.Utils;
import org.apache.ibatis.session.SqlSession;

public class checkService {
    public boolean registerCHE(registerDto dto){
        SqlSession sqlSession = Utils.openSession();
        try{
            registerDao dao = sqlSession.getMapper(registerDao.class);
            int count =  dao.findUserCountById(dto);//Select("select count(u_id) from user where u_id = #{u_id} ")

            sqlSession.commit();

            return count >0 ;
        }catch (Exception e){
            sqlSession.rollback();
            throw new RuntimeException(e);
        }finally {
            sqlSession.close();
        }
    }
}
